<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.1.1.min.js"></script>
    <script>

        $(function () {
            $("#registerbtn").click(function () {
                $.post("../user/register", $("#register-form").serialize(),
                    function (data) {
                        console.log(data);
                        if (data.valid) {

                        } else {
                            alert("注册失败");
                        }
                    });
            });

        });
    </script>
</head>
<body>
用户注册
<form id="register-form" method="post">
    <p><input name="username" placeholder="注册账号" id="inputname"/></p>
    <p><input name="password" type="password" placeholder="注册密码"/></p>
    <p><input name="password2" type="password" placeholder="确认密码"/></p>
    <p><input name="phoneNumber" placeholder="电话号码"></p>
    <p>
        <button type="button" id="registerbtn">注册</button>
    </p>
</form>
</body>
</html>